package example;

// 注意继承初始化初始化 父类优先子类，且只有子类调有参构造，父类默认调无参
class GrandFather
{
    public GrandFather()
    {
        System.out.println("This is GrandFather!");
    }
    public GrandFather(String s)
    {
        System.out.println("This is GrandFather " + s);
    }
}
class Father extends GrandFather
{
    public Father()
    {
        System.out.println("This is Father!");
    }
    public Father(String s)
    {
        System.out.println("This is Father " + s);
    }
}
class Son extends Father
{
    public Son()
    {
        System.out.println("This is Son!");
    }
    public Son(String s)
    {
        System.out.println("This is Son " + s);
    }
}

public class Construct {
    public static void main(String[] args)
    {
        Son son1 = new Son();
        System.out.println("******************");
        Son son2 = new Son("**==**");
    }
}
